<div class="member box">

{$this->data['noticestr']}

<h3>custoumer list</h3>
{$this->data['pagination']}
<table class="list boards">
	<thead>
		<tr>
			<th>cid</th>
			<th>modtime</th>
			<th>cname</th>
			<th>clevel</th>
			<th>status</th>
			<th>opr</th>
		</tr>
	</thead>
	<tbody>

<!--{loop $this->data['queryre'] $data}-->
		<tr class='old'>
<?php
	$clevelstr='';
	if(isset(ConstValues::$customerLevels[$data['clevel']]))
	{
		$clevelstr = ConstValues::$customerLevels[$data['clevel']];
	}
?>
			<td>{$data['cid']}</td>
			<td>{$data['itime']}</td>
			<td>{$data['cname']}</td>
			<td>{$clevelstr}</td>
			<td>{$data['status']}</td>
			<td>
<?php
				$tmpdelurl=C('LtUrl')->generate('manage','DoDeleteCustomer', array('cid'=>$data['cid']));
?>
				<a href='javascript:doDelConfirm({$data['cid']}, "{$tmpdelurl}")'>[delete]</a>&nbsp;&nbsp;
				<a href='{url('manage', 'DoEditCustomer', array('cid'=>$data['cid']))}'>[edit]</a>
			</td>
		</tr>
<!--{/loop}-->
	</tbody>
</table>
{$this->data['pagination']}
</div>

<div class="member box">
	<h3>custoumer add</h3>
	<form action="{url('manage', 'DoAddCustomer')}" method="post" id='customeradd' onsubmit="return doAddCustomerSubmit();">
		用户名: <input name="postdata[cname]" type="text" size="80" maxlength="100" /><br>
		级别:
<!--{loop ConstValues::$customerLevels $lvid $lvstr}-->
			<input name="postdata[clevel]" value='{$lvid}' type='radio'>{$lvstr}
<!--{/loop}-->
		<br>
		状态码: <input name="postdata[status]" type="text" size="80" maxlength="10" value='0'/><br>
		<input type='submit' value="添加">
	</form>
</div>

<script type="text/javascript">
function doDelConfirm(cid, delurl)
{
	if(confirm("确定删除 cid = "+cid+" ?"))
	{
		location = delurl;
	}
}

function doAddCustomerSubmit()
{
	return confirm("确定添加?");
}
</script>
